package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

import static java.lang.System.out;

public class Librarian {
    public String getLibrariannumber() {
        return librariannumber;
    }

    private String librariannumber;

    public String getLibrarianpassword() {
        return librarianpassword;
    }

    private String librarianpassword;

    public Librarian() {
        this.librariannumber = "098-0987";
        this.librarianpassword = "xxxxxxxxxx";
    }


    public String ShowLibrarianOptionsAndTakeInput() {
        Scanner input = new Scanner(System.in);
        String librarianoptions = "1. List Books checked out books \n2. List customers";
        System.out.println(librarianoptions);
        String librarianinput = input.next();
        acceptLibrarianOptionsAndProcess(librarianinput);
        return librarianoptions;
    }

    public void acceptLibrarianOptionsAndProcess(String librarianinput){
        Register register = new Register();
        if (librarianinput.equals("1")) {
            register.getCheckedOutBookList();
        }
        else if (librarianinput.equals("2"))
        {
//            Customer customer1 = new Customer("vishwas", "vishwas@gmail.com","8123244329","123-xxxx","vishw@s");
//            Customer customer2 = new Customer("vish", "vish@gmail.com","8123244329","124-xxxx","vishw@s");
//            List<Customer> customerlist = new ArrayList<Customer>();
//            customerlist.addAll(Arrays.asList(customer1, customer2));
            for (Customer list :register.customerlist)
            {
                System.out.println(list.getName());
            }

        }
    }
}
